package com.cie2.janji.entities;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.tapestry5.beaneditor.NonVisual;

@Entity
@Table(name="entity_role_in_time")
public class EntityRoleInTime {

	private Long id;

	private BaseEntity entity;
	
	private EntityRole role;
	
	private Boolean currentFlag;
	
	private Date startDate;
	
	private Date endDate;

	private String image;
	
	@Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @NonVisual	
	public Long getId() {
		return id;
	}	
	
    @ManyToOne
    @JoinColumn(name="ENTITY_ID")
	public BaseEntity getEntity() {
		return entity;
	}

    @ManyToOne
    @JoinColumn(name="ROLE_ID")
	public EntityRole getRole() {
		return role;
	}

	public Date getStartDate() {
		return startDate;
	}

	public Date getEndDate() {
		return endDate;
	}
	
	

	public String getImage() {
		return image;
	}

	public Boolean getCurrentFlag() {
		return currentFlag;
	}

	public void setCurrentFlag(Boolean currentFlag) {
		this.currentFlag = currentFlag;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public void setEntity(BaseEntity entity) {
		this.entity = entity;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setRole(EntityRole role) {
		this.role = role;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public void setImage(String image) {
		this.image = image;
	}

}
